package com.info.zhiduoduo.admin.controller;


import com.info.zhiduoduo.admin.model.formbean.value.ApproveValueFormBean;
import com.info.zhiduoduo.admin.model.formbean.value.QueryValueFormBean;
import com.info.zhiduoduo.admin.service.ValueService;
import com.info.zhiduoduo.common.annotation.LogEntity;
import com.info.zhiduoduo.common.annotation.LogParameter;
import com.info.zhiduoduo.common.annotation.ZddLog;
import com.info.zhiduoduo.common.constants.SmartResult;
import com.info.zhiduoduo.common.constants.system.ZddLogType;
import com.info.zhiduoduo.common.formbean.BaseSimpleFormBean;
import com.info.zhiduoduo.repository.entity.value.ValueServe;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(tags = "增值服务")
@RequestMapping("/admin/value")
@RestController
public class ValueServeController {


    @Resource
    private ValueService valueService;


    /**
     * 后台查询  增值服务列表
     * @return
     */
    @PostMapping("/queryAllServeList")
    public SmartResult queryAllServeList(@RequestBody BaseSimpleFormBean<QueryValueFormBean> baseSimpleFormBean){
        return valueService.queryAllServeList(baseSimpleFormBean);
    }


    /**
     * 审核操作
     * @param baseSimpleFormBean
     * @return
     */
    @ZddLog(type = ZddLogType.UPDATE,name = "审核操作",entities = @LogEntity(entity = ValueServe.class,parameters =
    @LogParameter(fields = "id",parameters = "formBean.reqdata.id")))
    @PostMapping("/approveValueServe")
    public SmartResult approveValueServe(@RequestBody BaseSimpleFormBean<ApproveValueFormBean> baseSimpleFormBean  ){
        return valueService.approveValueServe(baseSimpleFormBean);
    }




}
